package vn.allmobile.happyvoucher.loader;

import org.json.JSONObject;

 
 



import vn.allmobile.happyvoucher.loader.HomeHotLoader.Result;
import android.content.Context;
import android.util.Log;

public class HomeSliderLoader extends BaseLoader {
	
	private static final String TAG = "HomeSliderLoader";
	
	public HomeSliderLoader(Context context) {
		super(context);
		Log.i(TAG,"create home slider loader");
	}

	@Override
	protected BaseResult getResultInstance() {
		return new Result();
	}

	@Override
	protected UpdateTask getUpdateTask() {
		// TODO Auto-generated method stub
		return new HomeSliderUpdateTask();
	}

	@Override
	protected BaseResult parseResult(JSONObject paramJSONObject,
			BaseResult result) throws Exception {
		 Result localResult = (Result)result;
		 localResult.homeSliderTxt = "slider";
		 return localResult;
	}
	
	
	private class HomeSliderUpdateTask extends BaseLoader.UpdateTask
    {
        private HomeSliderUpdateTask()
        {
            super();
        }

		@Override
		protected Request getRequest() {			
		 
			return new Request("http://cdn.allmobile.vn/cdn/service/detail/appid/749");
		}
             
    }
	
	
	public static final class Result extends BaseResult
    {
        
        public String homeSliderTxt = "";
        protected int getCount()
        {        	 
        	return 1;
        }
        
        public BaseResult shallowClone()
        {
        	Result rs = new Result();
            rs.homeSliderTxt = this.homeSliderTxt;
            return rs;
        }
    }

}
